<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript">
            function doPopupWindow(obj) {
                var pkid = obj.parentNode.parentNode.parentNode.getAttribute("data-rk");
                var popupwindow = window.open("common/actInfoForm.xhtml?pkid=" + pkid, "", "height=600,width=800,left=200,top=100,toolbar=no,menubar=no,scrollbars=yes,location=no");
                popupwindow.focus;
            }
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>
        <style type="text/css">
            .col-95 {
                text-align: right;
                width: 90%;
            }

            .col-5 {
                width: 10%;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px">
            <p:tabView id="tabview" dynamic="true" cache="false" style="font-weight:normal;font-style:normal">
                <p:tab title="卡密码重置">
                    <h:form id="form">
                        <div id="qrytable">
                            <p:focus for="cardno"/>
                            <p:growl id="msgs" showDetail="false"/>
                            <p:panel style="margin-top:10px">
                                <h:panelGrid columns="2" cellspacing="5" columnClasses="col-95,col-5">
                                    <h:panelGrid columns="4" cellspacing="5" style="text-align: right;">
                                        <h:outputLabel value="卡号:" style="margin-left: 12px;"/>
                                        <p:inputText id="cardno" value="#{cardChgPwdAction.cardNo}" required="true"
                                                     requiredMessage="必须输入卡号！" size="30"/>
                                        <h:outputLabel value="证件号码:" style="margin-left: 12px;"/>
                                        <p:inputText id="name" value="#{cardChgPwdAction.idno}" required="true"
                                                     requiredMessage="必须输入持卡人证件号码！" size="30"/>
                                    </h:panelGrid>
                                    <h:panelGrid>
                                        <p:commandButton style="width:110px;" value="发送验证码"
                                                         action="#{cardChgPwdAction.onSendRandomCode}"
                                                         update="form,msgs">
                                        </p:commandButton>
                                    </h:panelGrid>
                                </h:panelGrid>
                                </p:panel>
                            <p:panel style="margin-top:10px">
                                <h:panelGrid columns="2" cellspacing="5" columnClasses="col-95,col-5">
                                    <h:panelGrid columns="4" cellspacing="5" style="text-align: right;">
                                        <h:outputLabel value="验证码:"/>
                                        <p:password id="pin" value="#{cardChgPwdAction.randomCode}" maxlength="6"
                                                    size="30"/>
                                        <h:outputLabel/><h:outputLabel/>
                                        <h:outputLabel value="新密码:"/>
                                        <p:password id="newPin" value="#{cardChgPwdAction.newPin}" maxlength="6"
                                                    size="30"/>
                                        <h:outputLabel value="确认新密码:"/>
                                        <p:password id="confirmNewPin" value="#{cardChgPwdAction.confirmNewPin}"
                                                    maxlength="6" size="30"/>
                                    </h:panelGrid>
                                    <h:panelGrid>
                                        <p:commandButton style="width:110px;" value="密码重置"
                                                         action="#{cardChgPwdAction.onReset}"
                                                         update="form,msgs">
                                        </p:commandButton>
                                    </h:panelGrid>
                                </h:panelGrid>
                            </p:panel>
                            <p:ajaxStatus style="height:18px;text-align:center">
                                <f:facet name="start">
                                    <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                                </f:facet>
                                <f:facet name="complete">
                                    <h:outputText value=""/>
                                </f:facet>
                            </p:ajaxStatus>
                        </div>
                    </h:form>
                </p:tab>
            </p:tabView>
        </div>
    </ui:define>
</ui:composition>